﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCombatManager
{
    private PlayerBody Player;

    private float combatInterval = 3f;
    Timer combatTimer;

    public PlayerCombatManager(PlayerBody player)
    {
        Player = player;
        EventManager.Listen(EventName.Player.TakeDamage,OnCombat);
        EventManager.Listen(EventName.Enemy.TakeDamage, OnCombat);
        combatTimer = new Timer(combatInterval, true, Player.PlayerData.TimeScale, OutOfCombat);
    }

    public void OnCombat(params object[] obj)
    {
        Player.PlayerStatus.isInCombat = true;
    }

    public void OutOfCombat()
    {
        Player.PlayerStatus.isInCombat = false;
    }

    public void CombatDo()
    {

    }

    private void OutOfCombatDo()
    {

    }

    private void ShiledRecover()
    {

    }


}
